import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

class TapTextSpan extends TextSpan {
  TapTextSpan({
    String? text,
    List<InlineSpan>? children,
    TextStyle? style,
    MouseCursor? mouseCursor,
    void Function(PointerEnterEvent)? onEnter,
    void Function(PointerExitEvent)? onExit,
    void Function()? onTap,
    String? semanticsLabel,
    Locale? locale,
    bool? spellOut,
  }) : super(
            text: text,
            children: children,
            style: style,
            recognizer: TapGestureRecognizer()..onTap = onTap,
            mouseCursor: mouseCursor,
            onEnter: onEnter,
            onExit: onExit,
            semanticsLabel: semanticsLabel,
            locale: locale,
            spellOut: spellOut);
}
